<!DOCTYPE html>
<html>
    <head>
        <title>Promise组件</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width">
        <script src="../avalon.js">

        </script>
        <script src="../highlight/shCore.js">

        </script>
        <script>
            require(["mmPromise/mmPromise","domReady!"], function() {
                var _resolve
                new Promise(function(resolve){
                    _resolve = resolve
                }).then(function(a){
                    vmodel.array.push(a)
                    return a  + 10
                }).then(function(a){
                    vmodel.array.push(a)
                    return a  + 10
                }).then(function(a){
                    vmodel.array.push(a)
                    return a  + 10
                }).then(function(a){
                    vmodel.array.push(a)
                    return a  + 10
                })
                var vmodel =  avalon.define("test", function(vm) {
                    vm.click = function(){
                        _resolve(1000)
                    }
                    vm.array = ["准备开始"]
                })
                avalon.scan()
            })
        </script>
    </head>
    <body ms-controller="test">
        <ul>
            <li ms-repeat="array">{{el}}</li>
        </ul>
        <p><button ms-click="click" type="button">点我开始</button></p>
            
    </body>
</html>
